@echo off
IF (%1) == () GOTO ALL

rem rd release /q /s

python setup.py bdist_egg --dist-dir _release_ %1
IF ERRORLEVEL 1 GOTO END

rd %1.egg-info /q /s
rd build /q /s

GOTO CLOSE

:ALL
python setup.py bdist_egg --dist-dir _release_ test
IF ERRORLEVEL 1 GOTO END
rd test.egg-info /q /s
rd build /q /s

python setup.py bdist_egg --dist-dir _release_ power
IF ERRORLEVEL 1 GOTO END
rd power.egg-info /q /s
rd build /q /s

python setup.py bdist_egg --dist-dir _release_ room
IF ERRORLEVEL 1 GOTO END
rd room.egg-info /q /s
rd build /q /s

:END
pause

:CLOSE
